<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类选择器</title>
    <style>
        /* 行为伪类 */
        button:active {
            background-color: red;
            color: white;
        }
        p:hover {
            background: yellow;
        }
        ::selection {
            background-color: blue;
            color: white;
        }
        /* 状态伪类 */
        input:focus {
            border: 8px solid blue;
        }
        input:checked + label {
            font-weight: bold;
        }
        /* 结构伪类 */
        li:nth-child(odd) {
            background-color: lightgray;
        }
        li:nth-child(even) {
            background-color: gray;
        }
        /* 条件伪类 */
        li:not(:last-child) {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>伪类选择器示例</h1>
        <button>点击我</button>
        <p>鼠标悬浮在这里</p>
        <input type="text" placeholder="输入框" autofocus>
        <input type="checkbox" id="option1">
        <label for="option1">选项1</label>
        <input type="checkbox" checked id="opintion2">
        <label for="option2">选项2</label>
        <ul>
            <li>列表1</li>
            <li>列表2</li>
            <li>列表3</li>
            <li>列表4</li>
        </ul>
    </div>
</body>
</html>